<%-- 
    Document   : ExamenSave
    Created on : 10/10/2011, 04:11:06 PM
    Author     : Alumnos
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*" %>
<%@page import="java.util.*" %>
<%
        Connection conn = null;
        try {
            String sc = "jdbc:mysql://localhost:3306/upeu?user=root&password=";
            Class.forName("com.mysql.jdbc.Driver");
            conn = DriverManager.getConnection(sc);
            System.out.println("Conectado");
            //test
            String qry="insert into alumno(nombre, photo,email,celular,login,password,privilege,activeaccount,forcepasswordchange,datecreate) values(?,?,?,?,?,?,?,?,?,?)";
            PreparedStatement ps=conn.prepareStatement(qry);
            ps.setString(1, request.getParameter("nombre"));
            ps.setString(2, request.getParameter("photo"));
            ps.setString(3, request.getParameter("email"));
            ps.setString(3, request.getParameter("celular"));
            ps.setString(3, request.getParameter("login"));
            ps.setString(3, request.getParameter("password")); 
            ps.setString(3, request.getParameter("privilege"));
            ps.setString(3, request.getParameter("activeaccount"));
            ps.setString(3, request.getParameter("forcepasswordchange"));
            ps.setString(3, request.getParameter("datecreate"));
          
                  
           
            int r=ps.executeUpdate();
            out.println(r+" registros agregados en la tabla user "+"<br>");
            
        } catch (Exception e) {
            out.print("Error: " +e.getMessage());
        }
%>  
<a href="ExamenMain.jsp">Volver->></a>
